package com.lovo.web.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDate;

/**
 * 用户订单
 */
@Getter
@Setter
@TableName("user_order")
@NoArgsConstructor
@ApiModel(value ="用户订单实体类",description = "用户订单实体类")
public class UserOrderBean {

    /**订单主键*/
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    @ApiModelProperty(value = "订单主键")
    private long orderId;

    /**订单编号*/
    @TableField("uo_orderNum")
    @ApiModelProperty(value = "订单编号")
    private String orderNum;

    /**购买用户名*/
    @TableField("fk_buyerName")
    @ApiModelProperty(value = "购买用户名")
    private String buyerName;


    /**商品类型*/
    @TableField("uo_type")
    @ApiModelProperty(value = "商品类型")
    private String type;

    /**商品名*/
    @TableField("uo_goodsname")
    @ApiModelProperty(value = "商品名")
    private String goodsName;

    /**商品规格*/
    @TableField("uo_specs")
    @ApiModelProperty(value = "商品规格")
    private String specs;

    /**购买数量*/
    @TableField("uo_goodsNum")
    @ApiModelProperty(value = "购买数量")
    private int goodsNum;

    /**下单时间*/
    @TableField("uo_date")
    @ApiModelProperty(value = "下单时间")
    private LocalDate date=LocalDate.now();

    /**商品单价*/
    @TableField("uo_goodsPrice")
    @ApiModelProperty(value = "商品单价")
    private float goodsPrice;

    /**商品总价*/
    @TableField("uo_totalPrice")
    @ApiModelProperty(value = "商品总价")
    private float totalPrice;

    /**实付款（折后）*/
    @TableField("uo_buyPrice")
    @ApiModelProperty(value = "实付款（折后）")
    private float buyPrice;

    /**付款时间*/
    @TableField("uo_payDate")
    @ApiModelProperty(value = "付款时间")
    private LocalDate payDate;

    /**客户名*/
    @TableField("uo_userName")
    @ApiModelProperty(value = "客户名")
    private String userName;

    /**是否删除*/
    @TableField("uo_delete")
    @ApiModelProperty(value = "是否删除")
    private int isDelete=0;

    /**客户地址*/
    @TableField("uo_userAddress")
    @ApiModelProperty(value = "客户地址")
    private String userAddress;

    /**客户电话*/
    @TableField("uo_userPhone")
    @ApiModelProperty(value = "客户电话")
    private String userPhone;

    /**订单状态*/
    @TableField("uo_status")
    @ApiModelProperty(value = "订单状态")
    private int status=0;

    @TableField("uo_payType")
    @ApiModelProperty("支付方式") // 0-预存款  1-支付宝
    private int payType=0;

    public UserOrderBean(String orderNum, String type, String goodsname, String specs, int goodsNum, float goodsPrice, float totalPrice, float buyPrice,String userName, String userAddress, String userPhone) {
        this.orderNum = orderNum;
        this.type = type;
        this.goodsName = goodsname;
        this.specs = specs;
        this.goodsNum = goodsNum;
        this.goodsPrice = goodsPrice;
        this.totalPrice = totalPrice;
        this.buyPrice = buyPrice;
        this.userName = userName;
        this.userAddress = userAddress;
        this.userPhone = userPhone;
    }
}
